<?php
defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
extract($this->data->information);//all keys become variables

$exercise=explode("-",$exercise);
$tmp=explode(",",$exercise[0]);
$tmp1=explode(",",$exercise[1]);
$exercise=array_combine($tmp,$tmp1);

$workoutinweek=explode("-",$workoutinweek);
$tmp=explode(",",$workoutinweek[0]);
$tmp1=explode(",",$workoutinweek[1]);
$workoutinweek=array_combine($tmp,$tmp1);

$user = JFactory::getUser();
?>
<h2 class="titlepage">Motionsvaner/ ønsker</h2>
<div class="eachBox creater-user-box clearfix"> 
    <div class="cont-box">
        <form id="member-edit" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.step3'); ?>" method="post" class="form-validate">
        <div class="wrapCreaterUser step-3">
            <div class="col-info-1 spisevaner">
                    <h6>Dine nuværende motionsvaner:</h6>                                 
                    <div class="eachRow eachQuestion clearfix"> 
                        <div class="question">Dyrker du nogen form for motion</div> 
                        <span class="uper">Ja/Nej</span>                                       
                        <input type="radio" class="radioip no" value="" name="1" <?php if(!$meget) echo "checked"?>>
                        <input type="radio" class="radioip yes" value="1" name="1" <?php if($meget) echo "checked"?>> 
                        <div class="in-question clearfix <?php echo $meget ? '' : 'hide';?>" id="opt1"> 
                            <p class="in-lb">Hvis ja, hvilken og hvor meget?</p> 
                            <input class="txtip mw100" type="text" name="meget" id="meget" value="<?php echo $meget?>">
                        </div>
                    </div> 
                    <div class="form-exercises"> 
                        <h6>Mulige kostvaner:</h6>
                        <p>Hvilken former for motion/træning kan kan du lide?</p>
                        <div class="choice exercises clearfix">                                        
                                <div class="eachInput divi-col divi-1-2 m-l-0">
                                    <label><p>Styrketræning</p>  <input class="ck" type="checkbox" name="exercise[0]" <?php if($exercise[0]) echo "checked"?> value="Styrketræning"></label> 
                                </div>
                                <div class="eachInput divi-col divi-1-2">
                                    <label><p>Aerobic</p>  <input class="ck" type="checkbox" name="exercise[1]" <?php if($exercise[1]) echo "checked"?> value="Arobice"></label>
                                </div>
                                <div class="eachInput divi-col divi-1-2 m-l-0">
                                    <label><p>Løb</p>  <input class="ck" type="checkbox" name="exercise[2]" <?php if($exercise[2]) echo "checked"?> value="Løb"></label> 
                                </div>
                                <div class="eachInput divi-col divi-1-2">
                                    <label><p>Cykling</p>  <input class="ck" type="checkbox" name="exercise[3]" <?php if($exercise[3]) echo "checked"?> value="Cykling"></label>
                                </div>   
                                <div class="eachInput divi-col divi-1-2 m-l-0">
                                    <label><p>Gåture</p>  <input class="ck" type="checkbox" name="exercise[4]" <?php if($exercise[4]) echo "checked"?> value="Gåture"></label> 
                                </div>
                                <div class="eachInput divi-col divi-1-2">
                                    <label><p>Holdsport</p>  <input class="ck" type="checkbox" name="exercise[5]" <?php if($exercise[5]) echo "checked"?> value="Holdsport"></label>
                                </div>
                                <div class="eachInput divi-col divi-1-2 m-l-0">
                                    <label><p>Crossfit</p>  <input class="ck" type="checkbox" name="exercise[6]" <?php if($exercise[6]) echo "checked"?> value="Crossfit"></label> 
                                </div>
                                <div class="eachInput divi-col divi-1-2">
                                    <label><p>Andet</p>  <input class="ck" type="checkbox" name="exercise[7]" <?php if($exercise[7]) echo "checked"?> id="other" value="<?php echo $exercise[7]?>"></label>
                                </div>
                                <div class="clearfix"></div>
                                <div class="in-question <?php echo $exercise[7] ? '' : ' hide'?>" id="opt2"> 
                                    <p class="in-lb">Hvis andet, hvad?</p> 
                                    <input type="text" class="txtip mw100" id="exercise" value="<?php echo $exercise[7]?>">
                                </div>          
                        </div><!-- choice exercises-->  
                    </div><!--form-kostvaner--> 
            </div><!--col-info-1-->
            <div class="col-info-2">
                <div class="form-motion">
                    <div class="eachRow eachInput selectlist sl-motion clearfix"> 
                        <p>Hvor mange timer kan du afsætte til  motion/træning om ugen</p>
                        <select class="select-sl" name="omugen" id="omugen"> 
                            <option <?php if($omugen=='1') echo "selected"?>>1</option>
                            <option <?php if($omugen=='2') echo "selected"?>>2</option>
                            <option <?php if($omugen=='3') echo "selected"?>>3</option>
                            <option <?php if($omugen=='4') echo "selected"?>>4</option>
                            <option <?php if($omugen=='5') echo "selected"?>>5</option>
                            <option <?php if($omugen=='6') echo "selected"?>>6</option>
                            <option <?php if($omugen=='7') echo "selected"?>>7</option>
                            <option <?php if($omugen=='8') echo "selected"?>>8</option>
                            
                            <option <?php if($omugen=='9') echo "selected"?>>9</option>
                            <option <?php if($omugen=='10+') echo "selected"?>>10+</option>
                        </select>
                    </div>
                </div>  <!--.form-motion-->
                <p>Hvilke dage kan du dyrke motion i</p>
                <div class="choice days clearfix">                                        
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label><p>Mandag</p>  <input class="ck" type="checkbox" name="workoutinweek[0]" <?php if($workoutinweek[0]) echo "checked"?> value="Mandag"></label> 
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label><p>Fredag</p>  <input class="ck" type="checkbox" name="workoutinweek[1]" <?php if($workoutinweek[1]) echo "checked"?> value="Tirsdag"></label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label><p>Tirsdag</p>  <input class="ck" type="checkbox" name="workoutinweek[2]" <?php if($workoutinweek[2]) echo "checked"?> value="Onsdag"></label> 
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label><p>Lørdag</p>  <input class="ck" type="checkbox" name="workoutinweek[3]" <?php if($workoutinweek[3]) echo "checked"?> value="Torsdag"></label>
                        </div>   
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label><p>Onsdag</p>  <input class="ck" type="checkbox" name="workoutinweek[4]" <?php if($workoutinweek[4]) echo "checked"?> value="Fredag"></label> 
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label><p>Søndag</p>  <input class="ck" type="checkbox" name="workoutinweek[5]" <?php if($workoutinweek[5]) echo "checked"?> value="Lørdag"></label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label><p>Torsdag</p>  <input class="ck" type="checkbox" name="workoutinweek[6]" <?php if($workoutinweek[6]) echo "checked"?> value="Søndag"></label> 
                        </div> 
                         <div class="eachRow eachQuestion no-border clearfix"> 
                            <div class="question">Har du nogle skader der gør at du ikke kan dyrke visse former for motion/træning?</div> 
                            <span class="uper">Ja/Nej</span>                                       
                            <input type="radio" class="radioip no" value="" name="3" <?php if(!$hvormeget) echo "checked"?>>
                            <input type="radio" class="radioip yes" value="1" name="3" <?php if($hvormeget) echo "checked"?>> 
                            <div class="in-question clearfix <?php echo $hvormeget ? '' : ' hide'?>" id="opt3"> 
                                <p class="in-lb">Hvis ja, hvilken og hvor meget?</p> 
                                <input class="txtip mw100" type="text" name="hvormeget" value="<?php echo $hvormeget?>">
                            </div>
                        </div><!-- eachQuestion-->   
                         <div class="in-question clearfix"> 
                            <p class="in-lb">Hvad motiverer dig til at tabe vægt eller forøge muskelmasse?</p> 
                            <input class="txtip mw100" type="text" name="motive" value="<?php echo $motive?>">
                        </div>

                </div><!-- choice days-->  
            </div><!--col-info-2-->                        
        </div><!--wrapCreaterUser-->                         
        <div class="wrap-btn-cru clearfix"> 
            <a class="btnGreen bntNext bntPrevious left" href="index.php?option=com_users&view=registration&layout=edit2"><span class="iconext"><img src="templates/fitplan/src_mobile/images/iconBack.png"></span> FORRIGE</a> 
            <a class="btnGreen bntNext right" href="javascript:void(0)" onclick="$('#member-edit').submit();"> Næste <span class="iconext"><img src="templates/fitplan/src_mobile/images/iconNext.png"></span></a> 
        </div>
        <input type="hidden" name="option" value="com_users" />
        <input type="hidden" name="task" value="profile.edit" />
        <input type="hidden" name="user_id" value=<?php echo $user->id?> />
        <?php echo JHtml::_('form.token');?>
        </form>                   
    </div><!-- cont-boX-->   
</div>
<script type="text/javascript">
	$(document).ready(function(){ 
		$("input[name=1]").change(function() {
			$("#opt1").toggleClass("hide");
			if(!$(this).val())
				$("#member-registration")[0].meget.value='';
		});

		$("#other").change(function() {
			$("#opt2").toggleClass("hide");
			if($(this).is(":checked")){
				$("#exercise").keyup(function(){$("#other").val($(this).val())});
			}
		});

		$("input[name=3]").change(function() {
			$("#opt3").toggleClass("hide");
			if(!$(this).val())
				$("#member-registration")[0].hvormeget.value='';
		});
	});
</script>
<?php return;?>
<style type="text/css">
	.w145{width:145px}
	.w290{width:290px}
</style>
<div class="wrapper">
				<div class="content" id="exerciseHabits-page">
					<div class="col-wrapper clearfix">
						<div class="info">
							<ul class="breadcrumb mb20">
					<li><a href="index.php?option=com_users&view=profile&layout=edit">Personlige oplysninger</a></li>
					<li><a href="index.php?option=com_users&view=profile&layout=edit2">Kostvaner/ønsker</a></li>
					<li class="active"><a >Motionsvaner/ønsker</a></li>
							</ul>
							 <form id="member-edit" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.step3'); ?>" method="post" class="form-validate">
							
								<h1 class="hd">Motionsvaner/ønsker</h1>
								<div class="colum2 bor mr30 fl">
									<div class="colum2-wra">
										<label>Dine nuværende motionsvaner:</label>
										<div><label class="fl mt10">Dyrker du nogen form for motion</label></div>
										<div class="fl ml60">
											<label class="uper">Ja/Nej</label>
											<input class="ra" type="radio" value="1" name="1" <?php if($meget) echo "checked"?>>
											<input class="ra" type="radio" value="" name="1" <?php if(!$meget) echo "checked"?> >
										</div>
										<div id="opt1" <?php echo $meget ? '' : 'class="desc"'?>>
											<label class="fl ita w150">Hvis ja, hvilken og hvor meget?</label>
											<div>
												<input  class="w161 ml100" name="meget" id="meget" value="<?php echo $meget?>">
											</div>
										</div>
									</div>
									<div class="colum2-wra">
										<label>Mulige motionsvaner:</label>
										<div class="mt10"><label>Hvilken former for motion/træning kan kan du lide?</label></div>
										<div class="fl w290">
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[0]" <?php if($exercise[0]) echo "checked"?> value="Styrketræning">Styrketræning
											</div>
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[1]" <?php if($exercise[1]) echo "checked"?> value="Arobice">Arobice
											</div>
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[2]" <?php if($exercise[2]) echo "checked"?> value="Løb">Løb
											</div>
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[3]" <?php if($exercise[3]) echo "checked"?> value="Cykling">Cykling
											</div>
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[4]" <?php if($exercise[4]) echo "checked"?> value="Gåture">Gåture
											</div>
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[5]" <?php if($exercise[5]) echo "checked"?> value="Holdsport">Holdsport
											</div>
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[6]" <?php if($exercise[6]) echo "checked"?> value="Crossfit">Crossfit
											</div>
											<div class="fl w145">
												<input class="fl ck2" type="checkbox" name="exercise[7]" <?php if($exercise[7]) echo "checked"?> id="other" value="<?php echo $exercise[7]?>">Andet
											</div>
										</div>
										<div class="fr w210<?php echo $exercise[7] ? '' : ' desc'?>" id="opt2">
											<label>Hvis andet, hvad?</label>
											<div>
												<input class="w161" id="exercise" value="<?php echo $exercise[7]?>">
											</div>
										</div>
									</div>
								</div>

								<div class="colum2 bor fr">
									<div class="w425">
										<label class="fl">Hvor mange timer kan du afsætte til<br> motion/træning om ugen</label>
										<select class="fr w96" name="omugen" id="omugen">
											<option <?php if($omugen=='1') echo "selected"?>>1</option>
											<option <?php if($omugen=='2') echo "selected"?>>2</option>
											<option <?php if($omugen=='3') echo "selected"?>>3</option>
											<option <?php if($omugen=='4') echo "selected"?>>4</option>
											<option <?php if($omugen=='5') echo "selected"?>>5</option>
											<option <?php if($omugen=='6') echo "selected"?>>6</option>
											<option <?php if($omugen=='7') echo "selected"?>>7</option>
											<option <?php if($omugen=='8') echo "selected"?>>8</option>
											
											<option <?php if($omugen=='9') echo "selected"?>>9</option>
											<option <?php if($omugen=='10+') echo "selected"?>>10+</option>
										</select>
									</div>
									<div class="clearfix">
										<label class="mb10">Hvilke dage kan du dyrke motion i</label>
										<div class="fl w100">
											<input class="ck3" type="checkbox" name="workoutinweek[0]" <?php if($workoutinweek[0]) echo "checked"?> value="Mandag">Mandag
										</div>
										<div class="fl w100">
											<input class="ck3" type="checkbox" name="workoutinweek[1]" <?php if($workoutinweek[1]) echo "checked"?> value="Tirsdag">Tirsdag
										</div>
										<div class="fl w100">
											<input class="ck3" type="checkbox" name="workoutinweek[2]" <?php if($workoutinweek[2]) echo "checked"?> value="Onsdag">Onsdag
										</div>
										<div class="fl w100">
											<input class="ck3" type="checkbox" name="workoutinweek[3]" <?php if($workoutinweek[3]) echo "checked"?> value="Torsdag">Torsdag
										</div>
										<div class="fl w100">
											<input class="ck3" type="checkbox" name="workoutinweek[4]" <?php if($workoutinweek[4]) echo "checked"?> value="Fredag">Fredag
										</div>
										<div class="fl w100">
											<input class="ck3" type="checkbox" name="workoutinweek[5]" <?php if($workoutinweek[5]) echo "checked"?> value="Lørdag">Lørdag
										</div>
										<div class="fl w100">
											<input class="ck3" type="checkbox" name="workoutinweek[6]" <?php if($workoutinweek[6]) echo "checked"?> value="Søndag">Søndag
										</div>
									</div>
									<div>
										<label>Har du nogle skader der gør at du ikke kan <br> dyrke visse former for motion/træning?</label>
									</div>
									<div style="float: right;" class="fl">
										<label class="uper">Ja/Nej</label>
										<input class="ra" type="radio" value="1" name="3" <?php if($hvormeget) echo "checked"?>>
										<input class="ra" type="radio" value="" name="3" <?php if(!$hvormeget) echo "checked"?>>
									</div>
									<div class="w425<?php echo $hvormeget ? '' : ' desc'?>" id="opt3">
										<label class="fl ita">Hvis ja, hvilken og hvor meget?</label>
										<div class="clear"></div>
										<div class="mb0 fr">
											<input class="w161 fr ml78" name="hvormeget" value="<?php echo $hvormeget?>">
										</div>
									</div>
									<div class="w425 mt10" style="margin-bottom: 31px">
										<label class="fl ita">Hvad motiverer dig til at tabe vægt eller<br> forøge muskelmasse?</label>
										<input class="w161 fr" name="motive" value="<?php echo $motive?>">
									</div>
								</div>

								<div class="clear"></div>
								<a class="fl bntPrevious" href="index.php?option=com_users&view=registration&layout=edit2">Forrige</a>
								<a class="fr bntNext" href="javascript:void(0)" onclick="$('#member-edit').submit();">Save</a>
								<input type="hidden" name="option" value="com_users" />
					<input type="hidden" name="task" value="profile.edit" />
					<input type="hidden" name="user_id" value=<?php echo $user->id?> />
					<?php echo JHtml::_('form.token');?>
							</form>
						</div>
					</div>
				</div>
			</div>
<script type="text/javascript">
	$(document).ready(function(){ 
		$("input[name=1]").change(function() {
			$("#opt1").toggleClass("desc");
			if(!$(this).val())
				$("#member-registration")[0].meget.value='';
		});

		$("#other").change(function() {
			$("#opt2").toggleClass("desc");
			if($(this).is(":checked")){
				$("#exercise").keyup(function(){$("#other").val($(this).val())});
			}
		});

		$("input[name=3]").change(function() {
			$("#opt3").toggleClass("desc");
			if(!$(this).val())
				$("#member-registration")[0].hvormeget.value='';
		});
	});
</script>